﻿
@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <title>ZYVideo</title>
    <script src="~/Assets/js/base/jquery.min.js"></script>
</head>
<body>
</body>
<script>
var option= {'SmgAddress':'@ViewBag.CModel.IpAddress'};
		init(option);
	 function init(options) {
    if (!!window.ActiveXObject || "ActiveXObject" in window) { } //判断是否是ie内核浏览器
    else {
        alert("请使用IE浏览器或IE内核打开！");
        return;
    }
    var defaults = {
        SvrType: '3',
        ConnectType: '0',
        SmgAddress: '@ViewBag.CModel.IpAddress', //10.36.190.200
        SmgPort: '5834',
        CameraID: '@ViewBag.CModel.Port', //1008
        type: 'zyh264',
        VideoEnable: '1',
        width: "100%",
        height: "100%",
        container: "body"
    };

    $.extend(defaults, options);

    var video = "<object style='width:800px;height:600px;' width='" + defaults.width + "' height='" + defaults.height + "' classid='clsid:7086A854-ED9F-4B83-94EE-E0F179113800'>"
                  + "<param name='SvrType' value='" + defaults.SvrType + "'/>"
                  + "<param name='ConnectType' value='" + defaults.ConnectType + "'/>"
                  + "<param name='SmgAddress' value='" + defaults.SmgAddress + "'/>"
                  + "<param name='SmgPort' value='" + defaults.SmgPort + "'/>"
                  + "<param name='CGIString' value='GET /CameraID=" + defaults.CameraID + "&type=" + defaults.type + " HTTP/1.0\r\n\r\n'/>"
                  + "<param name='VideoEnable' value='" + defaults.VideoEnable + "'/>"
                  + "<param name='wmode' value='opaque' />"//禁止ie video 一直置顶,遮住其他层
                  + "<embed wmode='opaque'></embed>"//禁止ie video 一直置顶,遮住其他层
                  + "</object>";

    //document.write(video);  
    //alert(video); 
    $(defaults.container).append(video);
  
};
</script>

</body>
</html>
